package client.control;

import base.BaseValue;

import java.util.HashMap;
import java.util.Map;

/**
  * @Description 评论有关的网络接口
  * @author 孔明浩
  * @Date 2020/4/8
  */
public class CommentControl {
    CommentControl(){}
    public ResponseEntity addComment(String token, int lastCommentId, int goodId, String message){
        ConnectControl connectControl = new ConnectControl();
        Map<String, String> map = new HashMap<>();
        map.put("lastCommentId", lastCommentId + "");
        map.put("goodId", goodId + "");
        map.put("message", message);
        connectControl.doPost(BaseValue.load + "addComment", token, map);
        return ResponseEntity.fit(connectControl);
    }

    public ResponseEntity getCommentByGoodId(int goodId){
        ConnectControl connectControl = new ConnectControl();
        Map<String, String> map = new HashMap<>();
        map.put("goodId", goodId + "");
        connectControl.doPost(BaseValue.load + "getCommentByGoodId", null, map);
        return ResponseEntity.fit(connectControl);
    }
}
